From a184b3bc5cef7ac2176b0910a782fa931c724f14 Mon Sep 17 00:00:00 2001 From: Camm Maguire Date: Fri, 22 May 2026 15:34:58 +0000 Subject: [PATCH] [PATCH] TODO: Put a short summary on the line above and replace this paragraph with a longer explanation of this change. Complete the meta-information with other relevant fields (see below for details). To make it easier, the information below has been extracted from the changelog. Adjust it or drop it. Gbp-Pq: Name Version_2_7_2pre24 --- Makefile.am | 7 +++++-- Makefile.in | 7 +++++-- cmpnew/gcl_cmpfun.lsp | 1 + cmpnew/gcl_cmpopt.lsp | 4 ++-- configure | 19 ++++++++++++------- configure.ac | 21 +++++++++++++-------- git.tag | 2 +- h/hppa-linux.h | 22 +++++++++++----------- h/m68k-linux.h | 14 +++++++------- h/mach64_aarch64_reloc.h | 8 ++++---- h/powerpc-linux.h | 12 ++++++------ h/sh4-linux.h | 16 ++++++++-------- lsp/gcl_mislib.lsp | 10 +++++++--- o/alloc.c | 9 +++++++-- o/funlink.c | 2 +- o/sfaslcoff.c | 6 +++++- o/sfaslelf.c | 8 +++++--- o/sfaslmacho.c | 16 +++++++++++----- 18 files changed, 111 insertions(+), 73 deletions(-) diff --git a/Makefile.am b/Makefile.am index 234a2c56..958d0215 100644 --- a/Makefile.am +++ b/Makefile.am @@ -272,8 +272,11 @@ unixport/raw_%: unixport/lib%.a $(FF) $(LF) $(CC) \ $$(otool -l $@ | bin/mac_arm_relink ps=$(SEGMENT_ALIGNMENT_BITS) base=$(TEXT_BASE)) \ $(AM_LDFLAGS) -rdynamic $(LDFLAGS) -o $@ $(FF) $< $(LF) $(LIBS) && \ - ("$$(printf '%s\n1167\n' $$(ld -v 2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1) | sort -V |head -n 1)" != "1167" || \ - ( printf '\x00\x00\x00\x00\x01\x00\x00\x00' | dd of=$@ bs=1 seek=64 conv=notrunc && \ + ( LV=$$(ld -v 2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1); \ + echo "Linker version $$LV" ; \ + [ "$$(printf '%s\n1167\n' $$LV | sort -r -V |head -n 1)" != "1167" ] || \ + ( echo "Patching" ; \ + printf '\x00\x00\x00\x00\x01\x00\x00\x00' | dd of=$@ bs=1 seek=64 conv=notrunc && \ codesign -s - --force $@ ))) unixport/gcl_cmpnopt_gcl_gprof.lsp unixport/gcl_cmpnopt_ansi_gcl_gprof.lsp:\ diff --git a/Makefile.in b/Makefile.in index 14686a75..c2de2206 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4584,8 +4584,11 @@ unixport/raw_%: unixport/lib%.a $(FF) $(LF) $(CC) \ $$(otool -l $@ | bin/mac_arm_relink ps=$(SEGMENT_ALIGNMENT_BITS) base=$(TEXT_BASE)) \ $(AM_LDFLAGS) -rdynamic $(LDFLAGS) -o $@ $(FF) $< $(LF) $(LIBS) && \ - ("$$(printf '%s\n1167\n' $$(ld -v 2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1) | sort -V |head -n 1)" != "1167" || \ - ( printf '\x00\x00\x00\x00\x01\x00\x00\x00' | dd of=$@ bs=1 seek=64 conv=notrunc && \ + ( LV=$$(ld -v 2>&1 | head -n 1 | awk '{print $$2}' | cut -f2 -d: | cut -d- -f2 | cut -d\. -f1); \ + echo "Linker version $$LV" ; \ + [ "$$(printf '%s\n1167\n' $$LV | sort -r -V |head -n 1)" != "1167" ] || \ + ( echo "Patching" ; \ + printf '\x00\x00\x00\x00\x01\x00\x00\x00' | dd of=$@ bs=1 seek=64 conv=notrunc && \ codesign -s - --force $@ ))) unixport/gcl_cmpnopt_gcl_gprof.lsp unixport/gcl_cmpnopt_ansi_gcl_gprof.lsp:\ diff --git a/cmpnew/gcl_cmpfun.lsp b/cmpnew/gcl_cmpfun.lsp index 0d86c6a0..9832a4a6 100644 --- a/cmpnew/gcl_cmpfun.lsp +++ b/cmpnew/gcl_cmpfun.lsp @@ -350,6 +350,7 @@ cadddr cdaddr cddadr cdddar cddddr logand lognot logior logxor c-type complex-real complex-imag ratio-numerator ratio-denominator cnum-type si::number-plus si::number-minus si::number-times si::number-divide ;FIXME more + si::expand-deftype ,@(mapcar (lambda (x) (cdr x)) (remove-if-not (lambda (x) (symbolp (cdr x))) +cmp-type-alist+)))) (si::putprop l t 'c1no-side-effects)) diff --git a/cmpnew/gcl_cmpopt.lsp b/cmpnew/gcl_cmpopt.lsp index ae129442..533800c5 100644 --- a/cmpnew/gcl_cmpopt.lsp +++ b/cmpnew/gcl_cmpopt.lsp @@ -895,9 +895,9 @@ (get 'truncate 'inline-always)) (push '((fixnum) (returns-exactly fixnum fixnum) #.(flags rfa)"({fixnum _t=(#0);@1(#0)-_t@ _t;})") (get 'truncate 'inline-always)) -(push '((short-float) (returns-exactly fixnum short-float) #.(flags rfa)"({float _t=(#0);@1(#0)-_t@ _t;})") +(push '((short-float) (returns-exactly fixnum short-float) #.(flags rfa)"({fixnum _t=(#0);@1(#0)-_t@ _t;})") (get 'truncate 'inline-always)) -(push '((long-float) (returns-exactly fixnum long-float) #.(flags rfa)"({double _t=(#0);@1(#0)-_t@ _t;})") +(push '((long-float) (returns-exactly fixnum long-float) #.(flags rfa)"({fixnum _t=(#0);@1(#0)-_t@ _t;})") (get 'truncate 'inline-always)) ;;COMPLEXP diff --git a/configure b/configure index 6e928787..1e0bcd3f 100755 --- a/configure +++ b/configure @@ -4189,6 +4189,10 @@ if test "$use" = "gnuwin95" ; then libboot="no" fi +case $use in + *86*gnu) libboot="no";; +esac + if test "$libboot" = "yes"; then AMM_LIBBOOT_TRUE= @@ -7210,7 +7214,8 @@ add_args_to_cflags -fsigned-char -pipe -fcommon \ -fno-PIE -fno-pie -fno-PIC -fno-pic \ -Wall \ -Wno-builtin-requires-header -Wno-empty-body -Wno-self-assign \ - -Wno-unused-but-set-variable -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \ + -Wno-unused-but-set-variable -Wno-tautological-compare \ + -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \ -fbracket-depth=512 add_args_to_ldflags -no-pie -Wl,-z,relro # -Wl,-z,lazy @@ -8858,10 +8863,10 @@ fi case $use in - sh4*) ;; #FIXME, these exceptions needed as of gcc 4.7 - hppa*) ;; #FIXME - powerpc*) ;; #FIXME - alpha*) ;; #FIXME +# sh4*) ;; #FIXME, these exceptions needed as of gcc 4.7 +# hppa*) ;; #FIXME +# powerpc*) ;; #FIXME +# alpha*) ;; #FIXME ia64*) ;; #FIXME *) { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking __builtin___clear_cache" >&5 @@ -8880,8 +8885,8 @@ int main (void) { - void *v,*ve; - __builtin___clear_cache(v,ve); + char v[1<<12]; + __builtin___clear_cache(v,v+sizeof(v)); ; return 0; diff --git a/configure.ac b/configure.ac index 999f5cce..088ea65f 100644 --- a/configure.ac +++ b/configure.ac @@ -82,6 +82,10 @@ if test "$use" = "gnuwin95" ; then AC_SUBST(LF) libboot="no" fi +case $use in + *86*gnu) libboot="no";; +esac + AM_CONDITIONAL([AMM_LIBBOOT],[test "$libboot" = "yes"]) if test "$libboot" = "yes" ; then @@ -276,7 +280,8 @@ add_args_to_cflags -fsigned-char -pipe -fcommon \ -fno-PIE -fno-pie -fno-PIC -fno-pic \ -Wall \ -Wno-builtin-requires-header -Wno-empty-body -Wno-self-assign \ - -Wno-unused-but-set-variable -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \ + -Wno-unused-but-set-variable -Wno-tautological-compare \ + -D_FILE_OFFSET_BITS=64 -D_TIME_BITS=64 \ -fbracket-depth=512 add_args_to_ldflags -no-pie -Wl,-z,relro # -Wl,-z,lazy @@ -830,19 +835,19 @@ AC_RUN_IFELSE( case $use in - sh4*) ;; #FIXME, these exceptions needed as of gcc 4.7 - hppa*) ;; #FIXME - powerpc*) ;; #FIXME - alpha*) ;; #FIXME +# sh4*) ;; #FIXME, these exceptions needed as of gcc 4.7 +# hppa*) ;; #FIXME +# powerpc*) ;; #FIXME +# alpha*) ;; #FIXME ia64*) ;; #FIXME *) - AC_MSG_CHECKING(__builtin___clear_cache) + AC_MSG_CHECKING([__builtin___clear_cache]) AC_RUN_IFELSE( [AC_LANG_PROGRAM( [[]], [[ - void *v,*ve; - __builtin___clear_cache(v,ve); + char v[1<<12]; + __builtin___clear_cache(v,v+sizeof(v)); ]])], [AC_DEFINE(HAVE_BUILTIN_CLEAR_CACHE,1,[have __builtin__clear_cache instruction]) AC_MSG_RESULT(yes)], diff --git a/git.tag b/git.tag index a56169f8..b73496cb 100644 --- a/git.tag +++ b/git.tag @@ -1 +1 @@ -"Version_2_7_2pre23" +"Version_2_7_2pre24" diff --git a/h/hppa-linux.h b/h/hppa-linux.h index 9a7eb6ed..9c4861a9 100755 --- a/h/hppa-linux.h +++ b/h/hppa-linux.h @@ -3,17 +3,17 @@ #define SGC #define STATIC_FUNCTION_POINTERS -#ifdef IN_SFASL -#include -#define CLEAR_CACHE_LINE_SIZE 32 -#define CLEAR_CACHE {\ - void *v1=memory->cfd.cfd_start,*v,*ve=v1+memory->cfd.cfd_size; \ - v1=(void *)((unsigned long)v1 & ~(CLEAR_CACHE_LINE_SIZE - 1));\ - for (v=v1;v */ +/* #define CLEAR_CACHE_LINE_SIZE 32 */ +/* #define CLEAR_CACHE {\ */ +/* void *v1=memory->cfd.cfd_start,*v,*ve=v1+memory->cfd.cfd_size; \ */ +/* v1=(void *)((unsigned long)v1 & ~(CLEAR_CACHE_LINE_SIZE - 1));\ */ +/* for (v=v1;v -int cacheflush(void *,int,int,int); -#define CLEAR_CACHE_LINE_SIZE 32 -#define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \ - v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\ - cacheflush(v,FLUSH_SCOPE_PAGE,FLUSH_CACHE_BOTH,ve-v);\ - } while(0) +/* #include */ +/* int cacheflush(void *,int,int,int); */ +/* #define CLEAR_CACHE_LINE_SIZE 32 */ +/* #define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \ */ +/* v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\ */ +/* cacheflush(v,FLUSH_SCOPE_PAGE,FLUSH_CACHE_BOTH,ve-v);\ */ +/* } while(0) */ #define C_GC_OFFSET 2 diff --git a/h/mach64_aarch64_reloc.h b/h/mach64_aarch64_reloc.h index 15fb35da..75bc3daa 100644 --- a/h/mach64_aarch64_reloc.h +++ b/h/mach64_aarch64_reloc.h @@ -43,10 +43,10 @@ addend=0; a&=0xfff; a>>=(((*q)>>29)&0x1)* /*not add/sub*/ - ((((*q)>>26)&0x1) ? /*simd*/ - ((((*q)>>22)&0x3) ? - (((*q)>>22)&0x3)+1 : (((*q)>>30)&0x1)) : - (((*q)>>30)&0x3)); /*gp*/ + (((((*q)>>26)&0x1)&& + (((*q)>>22)&0x1)&& + (!(((*q)>>30)&0x3))) ? /*simd hardcode*/ + 4 : (((*q)>>30)&0x3)); /*gp*/ store_val(q,MASK(12) << 10, a << 10); break; case ARM64_RELOC_UNSIGNED: diff --git a/h/powerpc-linux.h b/h/powerpc-linux.h index cc5fd2d5..e6bc3d0c 100644 --- a/h/powerpc-linux.h +++ b/h/powerpc-linux.h @@ -2,12 +2,12 @@ #define SGC -#define CLEAR_CACHE_LINE_SIZE 32 -#define CLEAR_CACHE do {void *v=memory->cfd.cfd_start,*ve=v+memory->cfd.cfd_size; \ - v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\ - for (;vcfd.cfd_start,*ve=v+memory->cfd.cfd_size; \ */ +/* v=(void *)((unsigned long)v & ~(CLEAR_CACHE_LINE_SIZE - 1));\ */ +/* for (;v -#define CLEAR_CACHE {\ - void *p=memory->cfd.cfd_start,*pe=p+memory->cfd.cfd_size; \ - p=(void *)((unsigned long)p & ~(PAGESIZE-1)); \ - for (;p */ +/* #define CLEAR_CACHE {\ */ +/* void *p=memory->cfd.cfd_start,*pe=p+memory->cfd.cfd_size; \ */ +/* p=(void *)((unsigned long)p & ~(PAGESIZE-1)); \ */ +/* for (;p dstp 0)) (if tzp tz (+ (truncate (- off) 3600) dstp)))))) -(defun encode-universal-time (s n h d m y &optional (tz (this-tz) tzp)) +(defun encode-universal-time (s n h d m y &optional (tz (this-tz) tzp) + &aux (tzo (* (- tz (this-tz)) 3600))) (declare (optimize (safety 2))) (check-type s (integer 0 59)) (check-type n (integer 0 59)) (check-type h (integer 0 23)) (check-type d (integer 1 31)) (check-type m (integer 1 12)) - (check-type y integer) + (check-type y (integer 1899)) (check-type tz rational) - (+ (mktime s n h d (1- m) (- y 1900) (if tzp 0 -1)) +secs-to-1970+ (* (- tz (this-tz)) 3600))) + (cond ((eql 1899 y) + (assert (and (eql h 23) (eql d 31) (eql m 12))) + (+ s (* n 60) tzo)) + ((+ (mktime s n h d (1- m) (- y 1900) (if tzp 0 -1)) +secs-to-1970+ tzo)))) (defun get-decoded-time () (decode-universal-time (get-universal-time))) diff --git a/o/alloc.c b/o/alloc.c index 743b6552..fe6715e5 100644 --- a/o/alloc.c +++ b/o/alloc.c @@ -1308,7 +1308,7 @@ gcl_init_alloc(void *cs_start) { ufixnum k; for (p=pagetochar(page(v)),k=0;ktm_nppage;k++,p+=tm->tm_size) { object o=p; - if (!is_free(o) && type_of(o)==t_cfdata && (void *)o->cfd.cfd_start>=data_start) + if (!is_free(o) && type_of(o)==t_cfdata && !o->d.tt && (void *)o->cfd.cfd_start>=data_start) gcl_mprotect((void *)o->cfd.cfd_start,o->cfd.cfd_nexp<fun.fun_minarg || nfargs>fun->fun.fun_maxarg))/*u.f.va -> varg, xxx*/ fas=0; - else if (u.f.va && VFUN_NARGS<0 && fun->fun.fun_minarg==fun->fun.fun_maxarg)/*runtime apply #arg checking omitted in reg fns*/ + else if (u.f.va && /* VFUN_NARGS<0 && */fun->fun.fun_minarg==fun->fun.fun_maxarg)/*runtime apply #arg checking omitted in reg fns*/ fas=0; /* else if (u.f.va && VFUN_NARGS<0 && */ /* (nargs-1fun.fun_minarg || nargs-1>fun->fun.fun_maxarg))/\*u.f.va -> varg, xxx*\/ */ diff --git a/o/sfaslcoff.c b/o/sfaslcoff.c index 7a71336f..c2d17a82 100644 --- a/o/sfaslcoff.c +++ b/o/sfaslcoff.c @@ -488,8 +488,12 @@ fasload(object faslfile) { massert(!un_mmap(st,est)); -#ifdef CLEAR_CACHE +#if defined(CLEAR_CACHE) CLEAR_CACHE; +#elif defined(HAVE_BUILTIN_CLEAR_CACHE) + __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size); +#else + #error "No clear cache" #endif if(symbol_value(sLAload_verboseA)!=Cnil) { diff --git a/o/sfaslelf.c b/o/sfaslelf.c index a71c5193..ae6d7741 100644 --- a/o/sfaslelf.c +++ b/o/sfaslelf.c @@ -627,10 +627,12 @@ fasload(object faslfile) { massert(!clear_protect_memory(memory)); -#if defined(HAVE_BUILTIN_CLEAR_CACHE) - __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size); -#elif defined(CLEAR_CACHE) +#if defined(CLEAR_CACHE) CLEAR_CACHE; +#elif defined(HAVE_BUILTIN_CLEAR_CACHE) + __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size); +#else + #error "No clear cache" #endif if(symbol_value(sLAload_verboseA)!=Cnil) { diff --git a/o/sfaslmacho.c b/o/sfaslmacho.c index cbf2c6ae..d4112771 100644 --- a/o/sfaslmacho.c +++ b/o/sfaslmacho.c @@ -31,6 +31,10 @@ #define LOAD_SEC(sec) ({ul _fl=sec->flags&SECTION_TYPE;\ (_fl<=S_SYMBOL_STUBS || _fl==S_16BYTE_LITERALS) && _fl!=S_ZEROFILL && !(sec->flags&S_ATTR_DEBUG);}) +#define GCL_EXTERNAL(sym) ((sym)->n_type & N_EXT || \ + (((sym)->n_type & N_TYPE) == N_SECT && \ + (sym)->n_sect == 1 && \ + !memcmp(strtab+(sym)->n_un.n_strx,"___",3))) #define MASK(n) (~(~0ULL << (n))) @@ -488,7 +492,7 @@ load_self_symbols() { for (a=c_table.ptable,sym=sym1;symn_type & N_STAB) || !(sym->n_type & N_EXT)) + if ((sym->n_type & N_STAB) || !GCL_EXTERNAL(sym)) continue; a->address=sym->n_value; @@ -504,7 +508,7 @@ load_self_symbols() { for (c_table.local_ptable=a,sym=sym1;symn_type & N_STAB) || sym->n_type & N_EXT) + if ((sym->n_type & N_STAB) || GCL_EXTERNAL(sym)) continue; a->address=sym->n_value; @@ -645,10 +649,12 @@ fasload(object faslfile) { massert(!clear_protect_memory(memory)); -#if defined(HAVE_BUILTIN_CLEAR_CACHE) - __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size); -#elif defined(CLEAR_CACHE) +#if defined(CLEAR_CACHE) CLEAR_CACHE; +#elif defined(HAVE_BUILTIN_CLEAR_CACHE) + __builtin___clear_cache((void *)memory->cfd.cfd_start,(void *)memory->cfd.cfd_start+memory->cfd.cfd_size); +#else + #error "No clear cache" #endif massert(!un_mmap(v1,ve)); -- 2.30.2